<?php
	header('Content-Type: text/html; charset=UTF-8');

	function media($notas)
	{
		$soma = 0;
		foreach($notas as $nota){
			$soma += $nota;
		}
		$num = count($notas);
		return $soma/$num;
	}
	
	echo media(array(1,5,3)); echo '<br />';
	echo media(array(2.5,7.5,1,5)); echo '<br />';
	echo media(array(2,6,4,5)); echo '<br />';
	echo media(array(1,1,2,2,3,3,4,4,10,20)); echo '<br />';
	echo media(array(7,5,2,14)); echo '<br />';
	echo media(array(7,9,8,8,8)); echo '<br />';
	echo media(array(10,9,11,6)); echo '<br />';
	echo media(array(10)); echo '<br />';
?>